package com.jshan.blog.enums;

import lombok.Getter;

@Getter
public enum TagInfoEnum {

    ACCOUNT_STATUS(1000, "账户状态"),
    USER_TAG(1001, "用户标签"),
    MENU_TYPE(1002, "菜单类型"),
    AUTH_STATUS(1003, "授权状态"),
    APP_TYPE(1004, "设备类型"),
    AUTH_TYPE(1005, "授权类型"),
    DATA_TYPE(1006, "数据类型"),
    DATA_AUTH_TYPE(1007, "数据权限关联类型");
    private int code;
    private String desc;

    TagInfoEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static TagInfoEnum getByCode(int code) {
        for (TagInfoEnum tagInfoEnum : TagInfoEnum.values()) {
            if (tagInfoEnum.getCode() == code) {
                return tagInfoEnum;
            }
        }
        return null;
    }
}
